// https://umijs.org/config/
import { defineConfig } from 'umi';
import defaultSettings from './defaultSettings';
import proxy from './proxy';
import router from './router';
import theme from './theme';

const { REACT_APP_ENV } = process.env;
export default defineConfig({
  hash: true,
  antd: {},
  dva: {
    hmr: true,
  },
  locale: {
    // default zh-CN
    default: 'zh-CN',
    // default true, when it is true, will use `navigator.language` overwrite default
    antd: true,
    baseNavigator: true,
  },
  dynamicImport: {
    loading: '@/components/PageLoading/index',
  },
  targets: {
    ie: 11,
  },
  // umi routes: https://umijs.org/docs/routing
  routes: router,
  // Theme for antd: https://ant.design/docs/react/customize-theme-cn
  theme,
  // @ts-ignore
  title: false,
  ignoreMomentLocale: true,
  proxy: proxy[REACT_APP_ENV || 'dev'],
  manifest: {
    basePath: '/',
  },
  // qiankun: {
  //   master: {
  //     apps: [
  //       {
  //         name: 'cloud-search-front',
  //         entry: 'https://10.1.30.2',
  //         mountElementId: 'root-slave',
  //       },
  //       {
  //         name: 'vue-project',
  //         entry: '//localhost:8080',
  //         mountElementId: 'root-slave',
  //       },
  //     ],
  //     jsSandbox: true,
  //     prefetch: true
  //   },
  // },
});
